package com.yuanfeng.business.controller;


import com.yuanfeng.business.dto.GdbMerchantTransportAreaDTO;
import com.yuanfeng.business.dto.ManagetransportAreaDeleteDTO;
import com.yuanfeng.business.dto.UserTokenBeanDTO;
import com.yuanfeng.business.dto.WapTransportAreaQueryDTO;
import com.yuanfeng.commoms.annnotation.Log;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName ShopTransportAreaController
 * @Description 售卖区域表
 * @Author cyp
 * @Date 2023-05-26 10:12:32
 * @Version 1.0
 **/
@RestController
@RequestMapping("shop/transportArea")
public class ShopTransportAreaController extends BaseController {

    /**
     * 查询可售区域
     *
     * @param param
     * @return
     */
    @PostMapping("/query")
    public ResponseResult query(@RequestBody WapTransportAreaQueryDTO param) {

        return shopTransportAreaService.query(param);
    }
    /**
     * 查询可售区域
     *
     * @param param
     * @return
     */
    @PostMapping("/queryTwo")
    public ResponseResult queryTwo(@RequestBody WapTransportAreaQueryDTO param) {

        return shopTransportAreaService.queryTwo(param);
    }

    /**
     * 删除售卖区域
     *
     * @param param
     * @return
     */
    @Log("删除售卖区域")
    @PostMapping("/delete")
    public ResponseResult delete(@RequestBody ManagetransportAreaDeleteDTO param) {
        return shopTransportAreaService.delete(param);
    }

    /**
     * 新增或更新售卖区域
     *
     * @param param
     * @return
     */
    @Log("新增或更新售卖区域")
    @PostMapping("/add")
    public ResponseResult add(@RequestBody GdbMerchantTransportAreaDTO param) {
        return shopTransportAreaService.add(param);
    }

    /**
     * 查询售卖区域详情页
     *
     * @param param
     * @return
     */
    @PostMapping("/queryDetail")
    public ResponseResult queryDetail(@RequestBody ManagetransportAreaDeleteDTO param) {
        return shopTransportAreaService.queryDetail(param);
    }


    /**
     * 查询商家售卖区域
     *
     * @param transportAreaId
     * @return
     */
    @GetMapping("/selectAreaById")
    public ResponseResult selectAreaById(@RequestParam("transportAreaId") Integer transportAreaId) {
        ResponseResult result=shopTransportAreaService.selectAreaById(transportAreaId);
        return result;
    }

    /**
     * 查询售卖区域
     *
     * @param param
     * @return
     */
    @PostMapping("/queryArea")
    public ResponseResult queryArea(@RequestBody UserTokenBeanDTO param) {
        return shopTransportAreaService.queryArea(param);
    }
}
